<?php

$conn = new mysqli('127.0.0.1','root','root','php');

if($conn->connect_errno != 0){
   
    echo "连接数据库失败";
    exit;
}

$conn->query("SET NAMES UTF8");

$res = $conn->query("select * from news where 1 = 1");


while($roww = $res->fetch_array(MYSQLI_ASSOC)){
    $rowws[] = $roww;
}

$count = count($rowws);
$pageSize = $count % 3 != 0 ? intval($count / 3) + 1 : $count / 3;

